package com.hongguan.oms.web.AfterServiceByPerson;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;

import com.hongguan.oms.common.Const;
import com.hongguan.oms.domain.UserInfo;
import com.hongguan.oms.service.AfterServiceByPerson.AfterServiceByPersonService;
import com.hongguan.oms.web.BaseHandler;

//UTF-8
/**
 *
 * @author	tonylin <br>
 * @create	2011-1-18 <br>
 * @project	Haojin <br>
 * @copyright 2011 HongGuan Information. All rights reserved
 * @desc <br>
 */
public class AfterServiceByPersonHead extends BaseHandler {
	private AfterServiceByPersonService afterServiceByPersonService;
	
	
	public void setAfterServiceByPersonService(
			AfterServiceByPersonService afterServiceByPersonService) {
		this.afterServiceByPersonService = afterServiceByPersonService;
	}

//	public ModelAndView updateOrderByPerson(HttpServletRequest request,
//			HttpServletResponse respnose) throws Exception {
//		
//		
//		
//	}



	public ModelAndView searchOrderByPerson(HttpServletRequest request,
			HttpServletResponse respnose) throws Exception {
		
		ModelAndView mv = null;
		mv = this.getSuccessModelView();
		Map<String, Object> map = new HashMap<String, Object>();
		UserInfo user = (UserInfo) request.getSession().getAttribute(
				Const.SESSION_USER);
		try {
		//ServicePerson 修改编码
			if(user.getUserName().equals("黄怡国") || user.getUserName().equals("胡佳俊") )
			{
				
			}else{
				map.put("ServicePerson", user.getUserName());
			}
			mv.addObject("result", afterServiceByPersonService.searchOrderByPerson(map));
			
			
			mv.addObject(SUCCESS, "true");
		}catch(Exception e){
			e.printStackTrace();
			mv.addObject(ERROR, "false");
		}
		return mv;
	}

}
